jQuery(function () {
	/**
	 * ==================== Create Function jQuery ==================== */
		jQuery.fn.alterClass = function ( removals, additions ) {
			var self = this;
			
			if ( removals.indexOf( '*' ) === -1 ) {
				// Use native jQuery methods if there is no wildcard matching
				self.removeClass( removals );
				return !additions ? self : self.addClass( additions );
			}
		 
			var patt = new RegExp( '\\s' + 
					removals.
						replace( /\*/g, '[A-Za-z0-9-_]+' ).
						split( ' ' ).
						join( '\\s|\\s' ) + 
					'\\s', 'g' );
		 
			self.each( function ( i, it ) {
				var cn = ' ' + it.className + ' ';
				while ( patt.test( cn ) ) {
					cn = cn.replace( patt, ' ' );
				}
				it.className = jQuery.trim( cn );
			});
		 
			return !additions ? self : self.addClass( additions );
		};
	    
		jQuery.fn.justtext = function() {
			   
		    return jQuery(this)  .clone()
		            .children()
		            .remove()
		            .end()
		            .text();
		 
		};
		
		//jQuery('div.myTab').noIdTab();
		jQuery.fn.noIdTab = function() {

	        this.each(function(){

	            var rand = 'spec' + (new Date()).getTime() + Math.floor((Math.random()*25)+65);

	            $(this).find('ul.super li a').each(function (index) {
	                $(this).attr("href", "#" + rand + index.toString());            
	            });

	            $(this).find('div.tab_el').each(function (index) {
	                $(this).attr("id", rand + index.toString());
	            });
	            $(this).tabs();

	        });
	    };
	/** END (Create Function jQuery)
	 * ============================================================== */
});

getIdUnique = function() {
	var charSet =  'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; //'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789',
	var charSetSize, charCount, idCount;

    charSetSize = charSet.length;
    charCount = 6;
    idCount = 1;
    
    // field validation
    if (!charSet || !charCount || !idCount) {
        alert('Fill in all fields.');
        return;
    }
    
    // prevents infinite loop when generatedIds
    // could not be fully populated
    if (charCount * charSetSize < idCount) {
        alert('Not enough uniques available.');
        return;
    }
    
    var id = '';
    for (var i = 1; i <= charCount; i++) {
        var randPos = Math.floor(Math.random() * charSetSize);
        id += charSet[randPos];
    }
    
   return id;
};